﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Error : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (null != Session["exception"])
            {
                Exception ex = (Exception)Session["exception"];
                this.ltlError.Text = GetTr("Message", ex.InnerException.Message)
                    + GetTr("StackTrace", ex.InnerException.StackTrace)
                    + GetTr("Data", ex.InnerException.Data.ToString())
                    + GetTr("Source", ex.InnerException.Source)
                    + GetTr("TargetSite", ex.InnerException.TargetSite.Name);
                
            }
        }
    }

    private string GetTr(string name,string value)
    {
        return "<tr><th widht=\"100px\" align=\"right\">"+name+"</th><td align=\"left\">"+value+"</td></tr>";
    }
}